package com.example.smartplay.mapper;

import com.example.smartplay.entity.Student;
import com.example.smartplay.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 
 * @since 2024-07-11
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    //查询邮箱是否存在
    @Select("select * from user where email = #{email}")
    Student findByEmail(String email);
    //通过student表中学生id查询user表中学生信息
    @Select("select * from user where student_id = #{id}")
    User selectByStudentId(Integer id);
    @Select("select * from club where id=#{id}")
    User selectByClubId(Integer id);
}
